package crawler.cnki.task;

import crawler.cnki.selenium.SeleniumDownloader;
import crawler.cnki.selenium.WebDriverPool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import redis.clients.jedis.JedisPool;
import us.codecraft.webmagic.Spider;
import us.codecraft.webmagic.scheduler.RedisScheduler;

import java.util.List;

@Component
public class ResearcherProcessor {

    public static Spider spider;

    @Autowired
    public void setSpider(Spider spider) {
        ResearcherProcessor.spider = spider;
    }

    public static void addurl(List<String> urls) {
        for (String url : urls) {
            spider.addUrl(url);
        }
    }
}